package com.qpl.depression.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qpl.depression.entity.Employee;
import com.qpl.depression.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @Desc
 * @Date 2021/5/13 10:45
 **/
@Controller
public class TeamController {
    @Autowired
    private EmployeeService employeeService;

    /**
     * 跳转到员工页面
     *
     * @param modelMap 存放数据
     * @return 员工页面
     */
    @GetMapping("team")
    public String team(ModelMap modelMap) {
        List<Employee> employees = employeeService.list(Wrappers.<Employee>lambdaQuery().eq(Employee::getStatus, 1));
        modelMap.addAttribute("employees", employees);
        return "team";
    }
}
